<?php
/**
 * RUBIK Solution & IT Development ltd.
 *
 * PROJECT		: Talkin' Thread - T-Shirt
 * COPYRIGHT	: 2008
 * ------------------------------------------------------
 * 
 * [GENERAL INFO OF THIS FILE] 
 *
 * @author			hoadn <hoadn@rubik.com.vn>
 * @package			[package name]
 *
 * Created on	: Nov 17, 2008
 */

// no direct access
defined ( '_FW_EXEC' ) or die ( 'Restricted access' );

RClassesImporter::cls('dbo.dtos.VisitHistoryDTO');
RClassesImporter::cls('dbo.dtos.VisitHistoryDetailDTO');

$dto = new LogHistoryDTO();
// Content
ob_start();
echo "Name login with: ";
echo SysAuthenticate::getUserName();
echo "\r\n";
echo "\r\n";

print_r($res);
echo "\r\n";
echo "\r\n";

echo '$_GET:';
print_r($_GET);
echo "\r\n";
echo "\r\n";

echo '$_POST:';
print_r($_POST);
echo "\r\n";
echo "\r\n";

echo '$_COOKIE:';
print_r($_COOKIE);
echo "\r\n";
echo "\r\n";

echo '$_SESSION:';
print_r($_SESSION);
echo "\r\n";
echo "\r\n";

$dto->log_content = ob_get_contents();
ob_end_clean();

SysDatabase::saveDTO($dto);

define('SYS_LOG_ID', $dto->getKeyValue());

/**
 * Log the error event
 *
 * @param SiteException $error
 */
function logErrorEvent($error) {
	$dto = new LogHistoryDTO();
	$dto->log_ref = SYS_LOG_ID;
	$dto->type = 'error';
	ob_start();
	
	echo "Name login with:".SysAuthenticate::getUserName()."\r\n\r\n";
	echo "Error Code:".$error->code."\r\n";
	echo "Error Message:".$error->message."\r\n\r\n";
	echo "Error Trace back:";
	print_r($error->getTrace());
	$dto->log_content = ob_get_contents();
	ob_end_clean();
	
	SysDatabase::saveDTO($dto);
}
?>